from skimage import exposure
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import cv2
myimg = cv2.imread('F:\python project\Code warehouse\insects_detection_pure_code2\\insects_imgs\\test3.jpg')
img = cv2.cvtColor(myimg, cv2.COLOR_BGR2GRAY)
img_eq = exposure.equalize_hist(img)
img_adapteq = exposure.equalize_adapthist(img, clip_limit=0.04)
plt.subplot(2, 2, 1), plt.title('src')
plt.imshow(img, cmap=cm.gray)
plt.subplot(2, 2, 2), plt.title('equalize_hist')
plt.imshow(img_eq, cmap=cm.gray)
plt.subplot(2, 2, 3), plt.title('equalize_adapthist')
plt.imshow(img_adapteq, cmap=cm.gray)
plt.show()

